package com.teamcenter.rac.massupdate.providers;

import com.teamcenter.rac.providers.delegates.AbstractOwnerDrawLabelProviderDelegate;
import com.teamcenter.rac.util.Registry;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.views.properties.IPropertySource;

public class PropertySourceLabelProvider
  extends AbstractOwnerDrawLabelProviderDelegate
{
  protected final Registry m_commonTableRegistry = Registry.getRegistry("com.teamcenter.rac.common.table.table");
  protected String m_propName;
  
  public PropertySourceLabelProvider(String paramString)
  {
    Assert.isNotNull(paramString);
    this.m_propName = paramString;
  }
  
  public Image getImage(Object paramObject)
  {
    if ((paramObject instanceof IPropertySource))
    {
      Object localObject = ((IPropertySource)paramObject).getPropertyValue(this.m_propName);
      if ((localObject instanceof String)) {
        return null;
      }
      if ((localObject instanceof Boolean))
      {
        if (((Boolean)localObject).booleanValue()) {
          return this.m_commonTableRegistry.getImage("yes.ICON");
        }
        return this.m_commonTableRegistry.getImage("no.ICON");
      }
    }
    return null;
  }
  
  public String getText(Object paramObject)
  {
    if ((paramObject instanceof IPropertySource))
    {
      Object localObject = ((IPropertySource)paramObject).getPropertyValue(this.m_propName);
      if ((localObject instanceof String)) {
        return (String)localObject;
      }
      if ((localObject instanceof Boolean)) {
        return null;
      }
    }
    return null;
  }
}


/* Location:              D:\下载\Fw_ 金卡反编译需求\com.teamcenter.rac.massupdate_11000.2.0.jar!\com\teamcenter\rac\massupdate\providers\PropertySourceLabelProvider.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */